<template>
  <web-view :src="url"></web-view>
</template>

<script lang="ts" setup>
  import { ref } from 'vue'
  import { onLoad } from '@dcloudio/uni-app'
  import { baseURL } from '@/utils/http'

  const url = ref('')
  onLoad((options) => {
    uni.setNavigationBarTitle({ title: options?.type })
    if (options?.type === '服务协议') {
      url.value = baseURL + '/file/userAgreement.html'
    } else if (options?.type === '隐私政策') {
      url.value = baseURL + '/file/privacyAgreement.html'
    } else if (options?.type === '用户协议') {
      url.value = baseURL + '/file/userAgreement2.html'
    }
  })
</script>

<style lang="scss" scoped></style>
